package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;
import org.example.entity.Lexicon;
import org.example.mapper.FenYeMapper;
import org.example.service.IFenYeService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IFenYeServiceImpl implements IFenYeService {

    private FenYeMapper fen;

    public IFenYeServiceImpl(FenYeMapper fen) {
        this.fen = fen;
    }

    @Override
    public List<Lexicon> fenYeAll(Integer page, Integer limit) {
        Page<Lexicon> page1 =  PageHelper.startPage(1,10);
        List<Lexicon> list = fen.selectList(null);
        System.out.println(page1.getPages());//获得总数据
        list.forEach(p -> System.out.println(p));

        return null;
    }
}
